package com.pheruagor.handmanager.storage.impl.sqlite {
    import com.pheruagor.handmanager.model.business.Club;
    import com.pheruagor.handmanager.model.business.Member;
    import com.pheruagor.handmanager.model.business.activity.PlayerActivity;

    import mx.collections.ArrayCollection;

    public class StorageTools {

        static public function createClub(id:String, name:String, creationDate:Date, members:ArrayCollection):Club {
            var result:Club = new Club();
            result.id = id;
            result.name = name;
            result.creationDate = creationDate;
            result.members = members;

            return result;
        }

        static public function createMember(id:String, clubId:String, avatarPath:String, clubEntryDate:Date, subscription:Number
            , activities:ArrayCollection, phoneNumber:String):Member {
            var result:Member = new Member();
            result.id = id;
            result.clubId = clubId;
            result.avatarPath = avatarPath;
            result.clubEntryDate = clubEntryDate;
            result.subscription = subscription;
            result.activities = activities;
            result.phoneNumber = phoneNumber;

            return result;
        }

        static public function createPlayerActivity(id:String, memberId:String, beginDate:Date, endDate:Date, description:String
            , isRightWingman:Boolean = false, isLeftBackcourt:Boolean = false, isCenterBackcourt:Boolean = false, isRightBackcourt:Boolean
            = false, isPivot:Boolean = false, isGuardian:Boolean = false):PlayerActivity {
            var result:PlayerActivity = new PlayerActivity();
            // general activity        	
            result.id = id;
            result.memberId = memberId;
            result.beginDate = beginDate;
            result.endDate = endDate;
            result.description = description;
            // specific to player activity
            result.isRightWingman = isRightWingman;
            result.isLeftBackcourt = isLeftBackcourt;
            result.isCenterBackcourt = isCenterBackcourt;
            result.isRightBackcourt = isRightBackcourt;
            result.isPivot = isPivot;
            result.isGuardian = isGuardian;

            return result;
        }
    }
}